package top.codeora.aiollama.tools;

import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ToolRegistration {


//    @Value("${search-api.api-key}")
//    private String searchApiKey;

    @Bean
    public ToolCallback[] allTools() {
        FileOperationTool fileOperationTool = new FileOperationTool();
        ResourceDownloadTool resourceDownloadTool = new ResourceDownloadTool();
//        WebSearchTool webSearchTool = new WebSearchTool(searchApiKey);
        WebSearch2XngTool webSearch2XngTool = new WebSearch2XngTool();
        TerminateTool terminateTool = new TerminateTool();

        return ToolCallbacks.from(
                webSearch2XngTool,
                fileOperationTool,
                resourceDownloadTool,
                terminateTool
        );
    }

}
